package com.lzq.principle.dependency;

/**
 * @author modify
 * @date 2022/11/5
 */
public class Demo {
    public static void main(String[] args) {
        Computer computer = new Computer();
        Cpu cpu = new IntelCpu();
        computer.setCpu(cpu);
        HardDesk hardDesk = new HardDeskA();
        computer.setHardDesk(hardDesk);
        Memory memory = new MemoryA();
        computer.setMemory(memory);

        computer.getCpu().run();
        computer.getHardDesk().save("HardDeskA");
        computer.getMemory().save();

    }
}
